<style>
    body,html{
        background-color: #F9F9F9;
    }
</style>
<script>
    window.onload = function(){

        var form = new xhForm($('#xh_form'));
        form.parse();

        {% if type == 2 %}
            $('[name="sProdIds[]"]').select2();
        {% endif %}

        //提交按钮处理事件
        $('#bt_modal_confirm',window.top.document).click(function () {
            form.submit('coop/saveInfo',{},function (res) {
                window.top.xhTop.showSuccess(res.msg);
                window.top.xhTop.getActiveFrame().obj.dataGrid.reload();
                window.top.xhTop.closeModal();
            });
        });
    }
</script>

<form id="xh_form" class="xh-form"  method="post"    style="margin-left: 20px;">
    <div class="xh-area-form">
        <table >
            <tr>
                <td><label>公司名称</label></td>
                <td><input type="text" name="sName"><input type="hidden" name="iType" value="{{ type }}"></td>
                <td><label>法人代表</label></td>
                <td><input type="text" name="sLegalName"></td>
            </tr>
            <tr>
                <td><label>电话</label></td>
                <td><input type="text" name="sPhoneNum"></td>
            </tr>
            <tr>
                <td><label>地址</label></td>
                <td colspan="3"><input type="text" name="sAddress"></td>
            </tr>
            {% if type == 2 %}
            <tr>
                <td><label>供应商品</label></td>
                <td colspan="3">
                    <select type="text" name="sProdIds[]" class="form-control" multiple="multiple">
                        {% for id,text in prods %}
                            <option value="{{ id }}">{{ text }}</option>
                        {% endfor %}
                    </select>
                </td>
            <tr>
            {% endif %}
            <tr>
                <td valign="middle"><label>备注</label></td>
                <td colspan="5">
                    <textarea name="mDesc" rows="5" border="0"></textarea>
                </td>
            </tr>

        </table>
    </div>
</form>